<?php
		 
					$loaihienthi=0;//0 là theo thời gian, 1 là theo giá.				 
					$dstrvBUS = new TinRaoVatBUS();
					
					$sanphamBUS= new SanPhamBUS();
					$tinhBUS =  new TinhBUS();
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title><link rel="stylesheet" type="text/css" href="css/sanpham1.css"/>
 
</head>

<body>
<div class="list_container"> 
    <div class="listing_tabs">
         <div id="tabarea_left">
            <ul id="tabnav">
                <li class="tab_all tab_active">
                            <strong>Tất&nbsp;cả</strong> 1 - 20 trong <strong>70294</strong> 
                </li>
                <li class="tab_private tab_inactive">
                    <a  href="#" title="Chỉ hiển thị tin rao của cá nhân" onclick="#">Cá&nbsp;nhân<span class="tab_right_links">, 45987</span></a>
                </li>                
                <li class="tab_company tab_inactive">
                    <a  href="#" title="Chỉ hiển thị tin quảng cáo của công ty" onclick="#">Công&nbsp;ty<span class="tab_right_links">, 24307</span></a>
                </li>
            </ul>
            <div class="clear"></div>
         </div>
         <div id="tabarea_right">
              <ul class="lastnav" id="tabnav">
               <li class="tab_right">
                  <div class="btn_order_group"> <a onclick="xt_med('C',xtn2,'hide_thumbnail','A'); return common.set_md('th');" href="http://www.chotot.vn/hà_nội/" title="Xem hình thu nhỏ" class="sort_price sort_left sort_active" rel="nofollow">
                      <div class="thumbs_img">
                          <div class="ll_item">
                              <div class="thumbs_dot"></div>
                              <div class="thumbs_line"></div>
                          </div>
                          <div class="ll_item">
                              <div class="thumbs_dot"></div>
                              <div class="thumbs_line"></div>
                          </div>
                          <div class="ll_item">
                              <div class="thumbs_dot"></div>
                              <div class="thumbs_line"></div>
                          </div>
                       </div></a>  
                     <a onclick="xt_med('C',xtn2,'hide_thumbnail','A'); return common.set_md('li');" href="#" title="Ẩn hình thu nhỏ" class="sort_price sort_right sort_inactive" rel="nofollow">
                      <div class="thumbs_img">
                            <div class="ll_item"><div class="no_thumbs_line">&nbsp;</div>
                      </div>
                      <div class="ll_item">
                            <div class="no_thumbs_line">&nbsp;</div>
                       </div><div class="ll_item">
                            <div class="no_thumbs_line">&nbsp;</div>
                       </div>
                       <div class="ll_item">
                            <div class="no_thumbs_line">&nbsp;</div>
                       </div>
                   </div></a>
          </div> 
         <div id="price_container"> <a href="" title="Tin&nbsp;mới&nbsp;trước" class="clock sort_left sort_active" rel="nofollow" onclick="xt_click(this,'C',xtn2,'sort_by_latest','A');"><?php $loaihienthi=0;?>
              <div class="cl_image"><div>&nbsp;</div>
              </div></a> <a href="" title="Giá rẻ trước" class="clock sort_right sort_inactive" rel="nofollow" onclick="xt_click(this,'C',xtn2,'sort_by_price','A');"><?php $loaihienthi=1;?><span class="vnd">VND</span><span class="down_arrow">↓</span></a>
          </div>  </li></ul>
      </div>
    <div class="clear"></div> 
</div> <!-- List container -->  <!-- Box container -->
<div class="_container">	
	<div class="box_container ">
		<div>
			<div class="content global_sprite_x">
				 <div class="box"> 
                 	<div>  <!-- Tab -->  
                    	<div class="TabContainer"> 
                        	<div class="listing-rows"> <!-- Ads --> 
                            <?php  //danh sách tin rao vặt
							if($loaihienthi==0) $dstrv = $dstrvBUS->getTinRaoVatSortByTime();
							else $dstrv = $dstrvBUS->getTinRaoVatSortByGia();
							
								foreach ($dstrv as $objtrv){
								?>
                            	<div id="hl" class="listing_thumbs">  
                                	<div class="chotot-list-row"> 
                                    	<div class="listing_thumbs_image">  
                                        	<div class="extra_img"> <a href="chitiettinraovat.php?idMatrv=<?php echo $objtrv->getMaTRV(); ?>"> <img width="70" height="70" border="0" title="Laptop lenovo " alt="Laptop lenovo " src="<?php echo $objtrv->getHinhAnh(); ?> " class="thumbnail"> </a> </div>    
                                        </div>             
                                        <div class="thumbs_subject" nowrap="nowrap"> <a class="ad-subject" href="chitiettinraovat.php?idMatrv=<?php echo $objtrv->getMaTRV(); ?>" title="Laptop lenovo "> <?php echo $objtrv->getTieuDe(); ?>  </a><br>
                                         	  <div class="ad-price"> <?php echo $objtrv->getGiaCa(); ?> VNĐ  </div>   <a title=" " href="" class="ad-category-region" onclick="xt_click(this,'C',xtn2,'subcategory_in_region','N');">
											  <?php $sanpham = $sanphamBUS->getSanPhamByMaSP($objtrv->getMaSP());
											  echo $sanpham->getTenSP(); ?>  
                                               <span class="municipality">ở <?php 
											   $tinh = $tinhBUS->getTinhByMaTRV($objtrv->getMaTRV());
											  foreach($tinh as $objtinhmrv) echo " ".$objtinhmrv->getTenTinh(); ?><!-- ở --></span>    </a> <span class="subtext">  </span>
                                         </div>   
                                        <div class="listing_thumbs_date" nowrap="nowrap">       3 phút trước    </div>
                                          <div class="clear_row">
                                          </div>
                                    </div>  
               <!-- Ads end --></div><?php  }?>				    
                 							
                   
                 			  <div class="clear"></div>
                              <div class="paging_container"> 
                                    	<div class="resultcontainer"> 
                                        	<div border="0" cellspacing="0" cellpadding="0" class="paging_table"> 
                                            	<div class="paging_first_page_link"> &nbsp; </div> 
                                                <div class="paging_links"> 
                                             	<ul class="pagination_ul">  
                                                	 <li class="pagination_li"><span class="pagination_span left_border border_left_radius">1</span></li>  
                                                     <li class="pagination_li"><a href="http://www.chotot.vn/hà_nội/?o=2" onclick="xt_click(this,'C',xtn2,'2','N');" class="pagination_link">2</a></li> 
                                                      <li class="pagination_li"><a href="http://www.chotot.vn/hà_nội/?o=3" onclick="xt_click(this,'C',xtn2,'3','N');" class="pagination_link">3</a></li>  
                                                      <li class="pagination_li"><a href="http://www.chotot.vn/hà_nội/?o=4" onclick="xt_click(this,'C',xtn2,'4','N');" class="pagination_link">4</a></li>  
                                                      <li class="pagination_li"><a href="http://www.chotot.vn/hà_nội/?o=5" onclick="xt_click(this,'C',xtn2,'5','N');" class="pagination_link">5</a></li>  
                                                      <li class="pagination_li"><a href="http://www.chotot.vn/hà_nội/?o=6" onclick="xt_click(this,'C',xtn2,'6','N');" class="pagination_link">6</a></li>  
                                                      <li class="pagination_li"><a href="http://www.chotot.vn/hà_nội/?o=7" onclick="xt_click(this,'C',xtn2,'7','N');" class="pagination_link">7</a></li>  
                                                      <li class="pagination_li"><a href="http://www.chotot.vn/hà_nội/?o=8" onclick="xt_click(this,'C',xtn2,'8','N');" class="pagination_link">8</a></li>  
                                                      <li class="pagination_li"><a href="http://www.chotot.vn/hà_nội/?o=9" onclick="xt_click(this,'C',xtn2,'9','N');" class="pagination_link">9</a></li>  
                                                      <li class="pagination_li"><a href="http://www.chotot.vn/hà_nội/?o=10" onclick="xt_click(this,'C',xtn2,'10','N');" class="pagination_link">10</a></li>  
                                                      <li class="pagination_li"><a href="http://www.chotot.vn/hà_nội/?o=11" onclick="xt_click(this,'C',xtn2,'11','N');" class="pagination_link">11</a></li>   
                                                      <li class="pagination_li"><a href="http://www.chotot.vn/hà_nội/?o=2" onclick="xt_click(this,'C',xtn2,'next_page','N');" class="pagination_link border_right_radius">»</a></li>  
                                                 </ul> 
                                              </div> 
                                                <div class="paging_last_page_link">  <a href="http://www.chotot.vn/hà_nội/?o=3515" onclick="xt_click(this,'C',xtn2,'last_page','N');" class="pagination_last_link left_border">Trang cuối</a>  
                                                 </div> 
                                                 <div class="clear">
                                                 </div> 
                                             </div> 
                                         </div>   
                                     </div> 
                           </div> 
                        </div> <!-- Banner list -->  
                       <div id="banner_list">  </div>  <!-- Banner list end --> 
                    </div> 
                 </div>
            </div>
        </div>
   </div>
<!-- Box container end -->
</div>
</body>
	 
</html> 